package vcp.gui.panels.parkingworker;

import java.awt.BorderLayout;
import java.awt.GridLayout;

import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.table.DefaultTableModel;

/**
 * Current rates panel
 */
public class PnlRatesCurrent extends JPanel {
	
	private static final long serialVersionUID = 1L;
    private static String[] header = {"Rate type", "amount"};
    private DefaultTableModel dtm = new DefaultTableModel(null, header) {

        @Override
        public Class<?> getColumnClass(int col) {
            return getValueAt(0, col).getClass();
        }
        public boolean isCellEditable(int row, int column){  
            return false;  
        }
        
      
    };
    private JTable table = new JTable(dtm);
    private JScrollPane scrollPane = new JScrollPane(table);
    private JScrollBar vScroll = scrollPane.getVerticalScrollBar();
    private int row;
    private boolean isAutoScroll;
	
	/**
	 * Create the panel.
	 */
	public PnlRatesCurrent() {
		table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		setLayout(new GridLayout(2, 1, 0, 0));
		this.setLayout(new BorderLayout());
       
        scrollPane.setVerticalScrollBarPolicy(
                JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
          
            this.add(scrollPane, BorderLayout.CENTER);
           
	}
	
	public DefaultTableModel getDtm() {
		return dtm;
	}
	public void setDtm(DefaultTableModel dtm) {
		this.dtm = dtm;
	}
	public JTable getTable() {
		return table;
	}
	public void setTable(JTable table) {
		this.table = table;
	}


	
}
